<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" errorPage="500.jsp"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
  <%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="../admin_css/hotFilmExhibition.css">
    <link rel="stylesheet" href="../admin_css/iconfont/iconfont.css">
    <script type="text/javascript" src="../js/jquery-1.12.4.js"></script>
</head>
<body>
<div class="content">
    <div class="container" style="padding: 0px;width: 100% ;">
    <div class="tou"><span class="iconfont icon-dianying1"></span><span style="font-weight: bold; margin-left: 6px;">热门电影管理</span></div>
    <table class="table" >
        <caption><span id="sum" style="margin-left: 30px;">共${sessionScope.hotFilmsSize}条</span></caption>
        <thead>
        <tr>
            <th>编号</th>
            <th>电影名称</th>
            <th>电影类型</th>
            <th>导演</th>
            <th>拍摄地</th>
            <th>主演</th>
            <th>首映时间</th>
            <th>片长</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="table">
        	<c:forEach items="${sessionScope.adminHotFilms }"  begin="0" end="6"  var="adminHotFilm">
        			<tr>
        				<input type="hidden"  name="filmForeignName" value="${adminHotFilm.filmForeignName}"/>
        				<input type="hidden"  name="filmIntroduce" value="${adminHotFilm.filmIntroduce}"/>
        				<input type="hidden"  name="filmIunguage" value="${adminHotFilm.filmIunguage}"/>
		                <td id="filmId1" class="filmId">${adminHotFilm.filmId}</td>
		                <td id="filmName1">${adminHotFilm.filmName}</td>
		                <td id="filmCategory1">
		                	<c:forEach items="${adminHotFilm.filmTypes}" var="filmtype">
		                	 	${filmtype.typeName}
		                	</c:forEach>
		                </td>
		                <td id="director1">
		                	<c:forEach items="${adminHotFilm.directors}" var="director">
		                	 	${director.dirName}
		                	</c:forEach>
		                </td>
		                <td id="screenwriters1">${adminHotFilm.filmPlace}</td>
		                <td id="star1">
		                	<c:forEach items="${adminHotFilm.performers}" begin="1" end="2" var="performer">
		                	 	${performer.perName}
		                	</c:forEach>
		                </td>
		                <td id="filmTime1">${fn:substring(adminHotFilm.filmShowTime,0,10)}</td>
		                <td id="playTime1">${adminHotFilm.filmTime}</td>
		                <td>
		                    <button id="but6" type="button" class="btn btn-default xiaBut" style="border:1px solid red;"><span>下架</span></button>
		                    <button id="but7" type="button" class="btn btn-default updateBut" style="border:1px solid red;"><span>修改</span></button>
		                </td>
           			 </tr>
        
        	</c:forEach>
        
        </tbody>
    </table>
    <!--分页-->
    <div id="fenye" class="panel-footer" style="text-align: center; display: block;">
        <nav style="height: 35px;">
            <ul class="pagination" style="margin-top:0px;">
                <li id="Previous" class="disabled" style="cursor: pointer;" flag="">
                      <span aria-hidden="true">«</span>    
                </li>

              
                <c:forEach items="${sessionScope.offTheShelfFilm}"  begin="0" end="${sessionScope.hotFilmsSize<=7?0:(sessionScope.hotFilmsSize/7)}" varStatus="temp">
                	   <li flag="${temp.count}" class="${param.flag == temp.count?'active':'' } data"><a href="${pageContext.request.contextPath}/hotFilmPage.do?page=${temp.count}&isDelete=0">${temp.count }</a></li>
                </c:forEach>
                
                
                <li id="li" style="cursor: pointer;">             
                      <span aria-hidden="true">»</span>
                </li>
            </ul>
        </nav>
        <div class="clearfix"></div>
    </div>
    <!--添加弹出框 -->
    <div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel" style="text-align: center;">电影信息添加</h4>
                      <span class="close"  >X</span>
                </div>
                <form action="${pageContext.request.contextPath}/addFilm.do"  onsubmit="return checkForm()" method="post" enctype="multipart/form-data">
                <input type="hidden" name="except" value="0">
	                <div class="text-center" style="margin-top: 15px; text-align: center;">
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影名称</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmName">
	                        </div>
	                    </div>
	                     <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影英文名</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmForeignName">
	                        </div>
	                    </div>
	                     <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影产地</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmPlace">
	                        </div>
	                    </div>
	                     <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影语言</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmIunguage">
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影图片</label>
	                        <div class="">
	                            <input type="file" name="filmImg" style="margin-left: 0px; display: inherit;width: 230px;" >
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影类型</label>
	                        <div class="">
	                       	<input class="filmTypeIds" type="hidden" name="typeId">
	                          <span class="plus" style="width:40px; height:40px;cursor:pointer; display:inline-block;margin-left:-600px;">
	                          		<img style="width:40px; height:40px;display: inline-block;" title="点击选择电影类型"  alt="" src="../img/banner_img/jia.png">
	                          </span>
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影导演</label>
	                        <div class="">
	                        	<input class="filmDirIds" type="hidden" name="dirId">
	                            <span class="plusDir" style="width:40px; height:40px;cursor:pointer; display:inline-block;margin-left:-600px;">
	                          		<img style="width:40px; height:40px;display: inline-block;" title="点击选择电影导演"  alt="" src="../img/banner_img/jia1.png">
	                         	</span>
	                        </div>
	                    </div>
	                  
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影演员</label>
	                        <div class="">
	                       		<input class="filmPerIds" type="hidden" name="perId">
	                            <span class="plusPer" style="width:40px; height:40px;cursor:pointer; display:inline-block;margin-left:-600px;">
	                          		<img style="width:40px; height:40px;display: inline-block;" title="点击选择电影演员"  alt="" src="../img/banner_img/jia2.png">
	                        	 </span>
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影首映时间</label>
	                        <div class="">
	                            <input type="date" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmShowTime">
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">片长</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmTime">
	                        </div>
	                    </div>
	                     <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影描述</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmIntroduce">
	                        </div>
	                    </div>
	                </div>
	                <div class="modal-footer" id="hotFilm" style="text-align: center;">
	                    <button id="btn3" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
	                    <input id="but4" type="submit" class="btn btn-danger" data-dismiss="modal" value="添加">
	                </div>
	                  
                </form>
                <!-- 电影类型弹出框 -->
				<div class="x_filmtype" >
					<div class="bannerTitle"><span>电影类型(${fn:length(sessionScope.admiFilmTypes)})</span> <span  class="close">X</span></div>
					<table class="layui-table">
				        <thead>
				          <tr>
				            <th>
				            	选择
				            </th>
				            <th>ID</th>
				            <th>类型</th>
				        </tr></thead>
				        <tbody>
				        <c:forEach items="${sessionScope.admiFilmTypes }" var="admiFilmType">
				        		 <tr>
						            <td>
						              <input typeId = "${admiFilmType.typeId}" type="checkbox" id="inputsEd" name="typeName">
						            </td>
						            <td class="typeId">${admiFilmType.typeId}</td>
						            <td>${admiFilmType.typeName}</td>
						           
						          </tr>
				        </c:forEach>
				       
				        </tbody>
				      </table>
				       <div style="width:70px;height:30px; margin:auto;margin-top:2px;">
				      <!--  <span id="determine"  style="color:red;font-size: 16px;cursor: pointer;border:1px solid red;padding:2px 2px;border-radius: 5px;">添加</span> -->
				        <button id="determine" type="button" class="btn btn-default show" style="border:1px solid red;"><span>添加</span></button>
				       </div>
				</div>
				<!-- 电影导演弹出框  -->
				<div class="x_filmDirector" >
					<div class="bannerTitle"><span>电影导演(${fn:length(sessionScope.adminFilmDirectors)})</span> <span  class="close1">X</span></div>
					<table class="layui-table">
				        <thead>
				          <tr>
				            <th>
				            	选择
				            </th>
				            <th>ID</th>
				            <th>导演名</th>
				            <th>性别</th>
				            <th>国籍</th>
				        </tr></thead>
				        <tbody>
				        <c:forEach items="${sessionScope.adminFilmDirectors }" var="adminFilmDirector">
				        		 <tr>
						            <td>
						              <input dirId = "${adminFilmDirector.dirId}" type="checkbox" id="inputsEd" name="dirName">
						            </td>
						           <td> ${adminFilmDirector.dirId}</td>
						            <td class="dirName">${adminFilmDirector.dirName}</td>
						            <td>${adminFilmDirector.dirSex}</td>
						             <td>${adminFilmDirector.dirNationnality}</td>
						           
						          </tr>
				        </c:forEach>
				       
				        </tbody>
				      </table>
				      <div style="width:70px;height:30px; margin:auto;margin-top:2px;">
				      <!--  <span id="determine"  style="color:red;font-size: 16px;cursor: pointer;border:1px solid red;padding:2px 2px;border-radius: 5px;">添加</span> -->
				        <button id="determine" type="button" class="btn btn-default show" style="border:1px solid red;"><span>添加</span></button>
				       </div>
				</div>
                
                <!-- 电影演员弹出框  -->
				<div class="x_filmPerformer" >
					<div class="bannerTitle"><span>电影演员(${fn:length(sessionScope.adminFilmPerformers)})</span> <span  class="close2">X</span></div>
					<table class="layui-table">
				        <thead>
				          <tr>
				            <th>
				            	选择
				            </th>
				            <th>ID</th>
				            <th>导演名</th>
				            <th>性别</th>
				            <th>国籍</th>
				        </tr></thead>
				        <tbody>
				        <c:forEach items="${sessionScope.adminFilmPerformers }" var="adminFilmPerformer">
				        		 <tr>
						            <td>
						              <input perId = "${adminFilmPerformer.perId}" type="checkbox" id="inputsEd" name="perName">
						            </td>
						             <th>${adminFilmPerformer.perId}</th>
						            <td class="perName">${adminFilmPerformer.perName}</td>
						            <td>${adminFilmPerformer.perSex}</td>
						             <td>${adminFilmPerformer.perNationnality}</td>
						           
						          </tr>
				        </c:forEach>
				       
				        </tbody>
				      </table>
				        <div style="width:70px;height:30px; margin:auto;margin-top:2px;">
				      <!--  <span id="determine"  style="color:red;font-size: 16px;cursor: pointer;border:1px solid red;padding:2px 2px;border-radius: 5px;">添加</span> -->
				        <button id="determine" type="button" class="btn btn-default show" style="border:1px solid red;"><span>添加</span></button>
				       </div>
				</div>
                
            </div>
            <!-- /.modal-content -->
        </div>
       		
    </div>
    
    
        <!--修改弹出框 -->
    <div class="modal fade" id="update" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel" style="text-align: center;">电影信息修改</h4>
                      <span class="closeUpdate" >X</span>
                </div>
                <form action="${pageContext.request.contextPath}/updateFilm.do"  onsubmit="return checkForm1()" method="post" >
                <input type="hidden" name="filmId">
                <input type="hidden" name="exceptFilm" value="0">
	                <div class="text-center" style="margin-top: 15px; text-align: center;">
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影名称</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmName">
	                        </div>
	                    </div>
	                     <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影英文名</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmForeignName">
	                        </div>
	                    </div>
	                     <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影产地</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmPlace">
	                        </div>
	                    </div>
	                     <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影语言</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmIunguage">
	                        </div>
	                    </div>
	                  
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影首映时间</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmShowTime">
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">片长</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmTime">
	                        </div>
	                    </div>
	                     <div class="form-group">
	                        <label for="firstname" class="col-sm-3 control-label">电影描述</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="filmIntroduce">
	                        </div>
	                    </div>
	                </div>
	                <div class="modal-footer" style="text-align: center;">
	                    <button id="btnClick" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
	                    <input id="butUpdate" type="submit" class="btn btn-danger" data-dismiss="modal" value="修改">
	                </div>
                </form>
              
                
            </div>
            <!-- /.modal-content -->
        </div>
       		
    </div>
    
    
    
    
    
    <div align="center" style="margin-bottom: 10px;padding-top: 10px; border-top: 1px solid #b3a6a6;">
        <button id="but2" type="button" class="btn btn-success" data-toggle="modal" data-target="#add" style=" width: 100px; height: 40px; line-height: 30px;">
            <span  style="margin-right: 6px; color:white; font-size: 16px;">√</span>
            <span style="color:white; font-weight: 800;font-size: 16px;">添加</span>
        </button>
        <button id="butupdate" type="button" class="btn btn-success" style=" width: 200px; height: 40px; line-height: 30px;">
            <span  style="margin-right: 6px; color:white; font-size: 16px;">√</span>
            <span id="is" style="color:white; font-weight: 800;font-size: 16px;">查看下架电影</span>
        </button>
    </div>
</div>




</div>



</body>
<script type="text/javascript" src="../admin_js/hotFilmExhibition.js"></script>
</html>